package marina;

import java.util.Scanner;

public class J09Account_ {
	public static void main(String[] args) {
		//입력값이 무엇인지, 메서드에 사용될 것은 어떤 것들이 있는지 파악하는 것이 중요.
		int aid[] = new int[2];
		double interestRate[] = new double[2];
		String dateCreated[] = new String[2];
		int balance[] = new int[2];
		int deposit[] = new int[2];
		int withdraw[] = new int[2];
		double monthlyInterestRate[] = new double[2];
		
		inputAccount(aid, balance, interestRate, dateCreated, deposit, withdraw);
		getMonthlyInterest(monthlyInterestRate, interestRate);
		withDraw(balance, withdraw);
		deposit(balance, deposit);
		
		System.out.println("계좌번호 : "+aid[1]);
		System.out.println("연간 이자율 : "+interestRate[1]);
		System.out.println("개설일 : "+dateCreated[1]);
		System.out.println("잔액 : "+balance[1]);
		System.out.println("입급 : "+deposit[1]);
		System.out.println("인출 : "+withdraw[1]);
		System.out.println("월간 이자율 : "+monthlyInterestRate[1]);
		
	} // main
	// 예금, 이자율, 인출, 입금 정보 입력
	public static void inputAccount(int aid[], int balance[], double interestRate[], String dateCreated[], int deposit[], int withdraw[]){
		Scanner sc = new Scanner(System.in);
		System.out.println("계좌번호는..?");
		aid[1] = sc.nextInt();
		System.out.println("잔액은..?");
		balance[1] = sc.nextInt();
		System.out.println("연간 이자율은..?");
		interestRate[1] = sc.nextDouble();
		System.out.println("통장 개설일은..?");
		dateCreated[1] = sc.next(); // 2014-03-15
		System.out.println("입급액은..?");
		deposit[1] = sc.nextInt();
		System.out.println("인출액은..?");
		withdraw[1] = sc.nextInt();
		sc.close();
	}
	// 월간 이자율 계산
	public static void getMonthlyInterest(double monthlyInterestRate[], double interestRate[]) {
		monthlyInterestRate[1] = interestRate[1] / 12;
	} // monthly
	// 인출
	public static void withDraw(int balance[], int withdraw[]) {
		balance[1] = balance[1] - withdraw[1];
	} // draw
	// 예금 
	public static void deposit(int balance[], int deposit[]) {
		balance[1] = balance[1] + deposit[1];
	} // deposit
}
